﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.Sys_Controllers>>" %>

<div style="line-height: 200%;">
    <fieldset>
        <legend>功能模块</legend>
        <div style="float: left; width: 0px;">
            <%foreach (var item in Model)
              {
                  if (item.SystemCode.Length == 3)
                  { //判断一下 下级是否有内容
                      if (Model.Any(a => a.SystemCode.StartsWith(item.SystemCode) && a.SystemCode != item.SystemCode))
                      {
                          Response.Write("</div>");
                          Response.Write("<div  style=\"float: left; width: 100px;\">");
                          Response.Write("<div style=\"font-weight:bold;\"><a>" + item.DisplayName + "</a></div>");
                      }
                  }
                  else
                  {
                      if (Model.Any(a => a.SystemCode.StartsWith(item.SystemCode) && a.SystemCode != item.SystemCode))
                      {
                          Response.Write("<a>" + ("└").PadLeft((item.SystemCode.Length - 3) / 3, '　') + " " + item.DisplayName + "</a>");
                      }
                      else
                      {
                          Response.Write(Ajax.ActionLink(("└").PadLeft((item.SystemCode.Length - 3) / 3, '　') + " " + item.DisplayName, "Index", item.ControllerName, null, new AjaxOptions() { UpdateTargetId = "Main" }, new { style = "display:block; " }));
                      }
                  } %>
            <%} %>
        </div>
    </fieldset>
</div>
